home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / JFC.bin / AccessibleSelection.java < prev    next >
Text File  |  1998-06-30  |  4KB  |  113 lines

  1. /*
  2.  * @(#)AccessibleSelection.java    1.4 98/02/04
  3.  * 
  4.  * Copyright (c) 1997 Sun Microsystems, Inc. All Rights Reserved.
  5.  * 
  6.  * This software is the confidential and proprietary information of Sun
  7.  * Microsystems, Inc. ("Confidential Information").  You shall not
  8.  * disclose such Confidential Information and shall use it only in
  9.  * accordance with the terms of the license agreement you entered into
  10.  * with Sun.
  11.  * 
  12.  * SUN MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF THE
  13.  * SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  14.  * IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  15.  * PURPOSE, OR NON-INFRINGEMENT. SUN SHALL NOT BE LIABLE FOR ANY DAMAGES
  16.  * SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR DISTRIBUTING
  17.  * THIS SOFTWARE OR ITS DERIVATIVES.
  18.  * 
  19.  */
  20.  
  21. package com.sun.java.accessibility;
  22.  
  23. /**
  24.  * This AccessibleSelection interface
  25.  * provides the standard mechanism for an assistive technology to determine 
  26.  * what the current selected children are, as well as modify the selection set.
  27.  * Any object that has children that can be selected should support this
  28.  * the AccessibleSelection interface.  Applications can determine if an object supports the 
  29.  * AccessibleSelection interface by first obtaining its AccessibleContext (see
  30.  * <a href="com.sun.java.accessibility.Accessible.html">Accessible</a>) and
  31.  * then calling the
  32.  * <a href="com.sun.java.accessibility.AccessibleContext.html#getAccessibleSelection">
  33.  * getAccessibleSelection</a> method of AccessibleContext.  If the return 
  34.  * value is not null, the object supports this interface.
  35.  *
  36.  * @see Accessible
  37.  * @see Accessible#getAccessibleContext
  38.  * @see AccessibleContext
  39.  * @see AccessibleContext#getAccessibleSelection
  40.  *
  41.  * @version     1.4 02/04/98 11:13:01
  42.  * @author    Peter Korn
  43.  * @author      Hans Muller
  44.  * @author      Willie Walker
  45.  */
  46. public interface AccessibleSelection {
  47.  
  48.     /**
  49.      * Returns the number of Accessible children currently selected.
  50.      * If no children are selected, the return value will be 0.
  51.      *
  52.      * @return the number of items currently selected.
  53.      */
  54.      public int getAccessibleSelectionCount();
  55.  
  56.     /**
  57.      * Returns an Accessible representing the specified selected child
  58.      * in the object.  If there isn't a selection, or there are 
  59.      * fewer children selected than the integer passed in, the return
  60.      * value will be null.
  61.      * <p>Note that the index represents the i-th selected child, which
  62.      * is different from the i-th child.
  63.      *
  64.      * @param i the zero-based index of selected children
  65.      * @return the i-th selected child
  66.      * @see #getAccessibleSelectionCount
  67.      */
  68.      public Accessible getAccessibleSelection(int i);
  69.  
  70.     /**
  71.      * Determines if the current child of this object is selected.
  72.      *
  73.      * @return true if the current child of this object is selected; else false.
  74.      * @param i the zero-based index of the child in this Accessible object.
  75.      * @see AccessibleContext#getAccessibleChild
  76.      */
  77.      public boolean isAccessibleChildSelected(int i);
  78.  
  79.     /**
  80.      * Adds the specified Accessible child of the object to the object's
  81.      * selection.  If the object supports multiple selections,
  82.      * the specified child is added to any existing selection, otherwise
  83.      * it replaces any existing selection in the object.  If the
  84.      * specified child is already selected, this method has no effect.
  85.      *
  86.      * @param i the zero-based index of the child
  87.      * @see AccessibleContext#getAccessibleChild
  88.      */
  89.      public void addAccessibleSelection(int i);
  90.  
  91.     /**
  92.      * Removes the specified child of the object from the object's
  93.      * selection.  If the specified item isn't currently selected, this
  94.      * method has no effect.
  95.      *
  96.      * @param i the zero-based index of the child
  97.      * @see AccessibleContext#getAccessibleChild
  98.      */
  99.      public void removeAccessibleSelection(int i);
  100.  
  101.     /**
  102.      * Clears the selection in the object, so that no children in the
  103.      * object are selected.
  104.      */
  105.      public void clearAccessibleSelection();
  106.  
  107.     /**
  108.      * Causes every child of the object to be selected
  109.      * if the object supports multiple selections.
  110.      */
  111.      public void selectAllAccessibleSelection();
  112. }
  113.